package com.heraleign.mybatis.service.impl;

import com.heraleign.mybatis.bean.Student;
import com.heraleign.mybatis.mapper.StudentMapper;
import com.heraleign.mybatis.service.StudentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Resource
    private StudentMapper mapper;
    @Override
    public List<Student> selectList() {
        return mapper.selectList();
    }

    @Override
    public Student selectStuById(Integer id) {
        return mapper.selectById(id);
    }

    @Override
    public int saveStu(Student stu) {
        return mapper.save(stu);
    }

    @Override
    public int updateStu(Student stu) {
        return mapper.update(stu);
    }

    @Override
    public int deleteById(Integer id) {
        return mapper.delete(id);
    }

    @Override
    public Student queryStudentByName(String stuName) {
        return mapper.queryStudentByStuName(stuName);
    }
}
